﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Esint.Common.Data.SqlDAL;
using System.Configuration;

namespace Esint.JudicialAuction.SqlDAL
{
   
    internal class BasicDataAccess : RootSqlDataAccess
    {
        public BasicDataAccess()
        {
            if (!RootSqlDataAccess.ConnectString.ContainsKey("Default"))
            {
                //RootSqlDataAccess.ConnectString["Default"] = Common.Security.SecurityHelper.DecryptString(ConfigurationManager.AppSettings["SqlDBConn"]);
                RootSqlDataAccess.ConnectString["Default"] = ConfigurationManager.AppSettings["SqlDBConn"];
            }
            CurrentConn = "Default";

            if (string.IsNullOrEmpty(RootSqlDataAccess.IsRecordSQL))
                RootSqlDataAccess.IsRecordSQL = ConfigurationManager.AppSettings["IsRecordSQL"];
        }

        public BasicDataAccess(string DbConn)
        {
            if (!RootSqlDataAccess.ConnectString.ContainsKey(DbConn))
            {
                RootSqlDataAccess.ConnectString[DbConn] = Common.Security.SecurityHelper.DecryptString(ConfigurationManager.AppSettings[DbConn]);
            }

            CurrentConn = DbConn;
            if (string.IsNullOrEmpty(RootSqlDataAccess.IsRecordSQL))
                RootSqlDataAccess.IsRecordSQL = ConfigurationManager.AppSettings["IsRecordSQL"];
        }

    }
}
